#Load the library and Create Reference to Library object 
require 'watir'
include Watir

# define variables
test_url = 'http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/AsyncFileUpload/AsyncFileUpload.aspx'
file_name = 'C:\Documents and Settings\ochubey\Desktop\to cover.txt'


puts 'tests execution started'
3.times do
  ie = Watir::IE.new
  ie.goto test_url
  ie.file_field(:id, 'ctl00_SampleContent_AsyncFileUpload1_ctl02').set(file_name)
  puts('The latest Server-side event: ' + ie.text_field(:id, 'ctl00_SampleContent_uploadResult').text)
  puts('Client-side events: ' + ie.text_field(:id, 'ctl00_SampleContent_clientSide').text)
  ie.close
end
puts 'tests execution finished'